package com.ccrfid.rmc6.repository.personnel;

import com.ccrfid.rmc6.entity.personnel.PersonnelHeartRateEntity;
import org.springframework.data.repository.Repository;

import java.sql.Timestamp;
import java.util.List;

public interface PersonnelHeartRateRepository extends Repository<PersonnelHeartRateEntity, Long> {

    PersonnelHeartRateEntity save(PersonnelHeartRateEntity entity);

    PersonnelHeartRateEntity getTopByPersonnelIdOrderByIdDesc(Long personnelId);

    List<PersonnelHeartRateEntity> getAllByPersonnelIdAndRecordTimeBetween(Long personnelId, Timestamp startTime, Timestamp stopTime);

    List<PersonnelHeartRateEntity> getAllByCardNumberAndRecordTimeBetween(Long cardNumber, Timestamp startTime, Timestamp stopTime);

    List<PersonnelHeartRateEntity> getTop5ByPersonnelIdAndRecordTimeLessThanOrderByIdDesc(Long personnelId, Timestamp checkTime);
}
